﻿using BCCommon;
using BCCommon.TMS.FreightEnums;
using BCCommon.TMS.Order;
using BCCommon.TMS.Transport;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCDto.TMS.Order.Order
{
    /// <summary>
    /// 创建订单基本信息
    /// </summary>
    public class OrderBaseRequestDto
    {

        #region 预约订单
        /// <summary>
        /// 预约订单
        /// </summary>
        [Display(Name = "预约订单")]
        [Required(ErrorMessage = "{0} 不能为空")]
        public bool IsBook { get; set; }
        /// <summary>
        /// 预约时间
        /// </summary>
        [Display(Name = "预约时间")]
        public DateTime? BookTime { get; set; }
        #endregion

        #region 发货人信息
        /// <summary>
        /// 发货人Id
        /// </summary>		
        [Display(Name = "发货人Id")]
        [Required(ErrorMessage = "{0} 不应为空")]
        public long UserId { get; set; }
        /// <summary>
        /// 发货人姓名
        /// </summary>		
        [Display(Name = "发货人姓名")]
        [Required(ErrorMessage = "{0} 不应为空")]
        [StringLength(20, MinimumLength = 2, ErrorMessage = "{0} 长度应大于{2} 且小于{1}")]
        public string Shipping { get; set; }
        /// <summary>
        /// 发货人电话
        /// </summary>		
        [Display(Name = "发货人电话")]
        [Required(ErrorMessage = "{0} 不应为空")]
        public string ShippingPhone { get; set; }
        /// <summary>
        /// 发货人地址（货物地址）
        /// </summary>		
        [Display(Name = "发货人地址（货物地址）")]
        [Required(ErrorMessage = "{0} 不应为空")]
        [StringLength(200, MinimumLength = 2, ErrorMessage = "{0} 长度应大于{2} 且小于{1}")]
        public string ShippingAddress { get; set; }
        #endregion

        #region 订单来源
        /// <summary>
        /// 订单来源
        /// </summary>
        [Display(Name = "订单来源")]
        [Required(ErrorMessage = "{0} 不应为空")]
        public OrderSourceType SourceType { get; set; }
        /// <summary>
        /// 物流类型
        /// </summary>
        [Display(Name = "物流类型")]
        [Required(ErrorMessage = "{0} 不应为空")]
        public FreightType FreightType { get; set; }
        #endregion

        #region 货物清单及地址信息
        /// <summary>
        /// 货物清单及地址信息
        /// </summary>
        [Display(Name = "货物清单及地址信息")]
        [Required(ErrorMessage = "{0} 不应为空")]
        public List<OrderGoodsBaseRequestDto> GoodsAddress { get; set; }
        /// <summary>
        /// 订单货物清单列表
        /// </summary>
        [Display(Name = "订单货物清单列表")]
        public List<OrderGoodsChecklistRequestDto> GoodsChecklist { get; set; }
        #endregion

        #region 业务类型信息
        /// <summary>
        /// 运输业务Id
        /// </summary>		
        [Display(Name = "运输业务Id")]
        [Required(ErrorMessage = "{0} 不应为空")]
        public int VehicleTransportBusinessConfigId { get; set; }
        /// <summary>
        /// 运输业务类型
        /// </summary>		
        [Display(Name = "运输业务类型")]
        [Required(ErrorMessage = "{0} 不应为空")]
        public TransportBusinessType VehicleTransportBusinessType { get; set; }
        /// <summary>
        /// 车辆类型Id
        /// </summary>
        [Display(Name = "车辆类型Id")]
        public int? VehicleTypeId { get; set; }
        /// <summary>
        /// 车型分类
        /// </summary>
        [Display(Name = "车型分类")]
        public string VehicleCategory { get; set; }
        /// <summary>
        /// 车型分类Id
        /// </summary>
        [Display(Name = "车型分类Id")]
        public int? VehicleCategoryReferenceId { get; set; }
        /// <summary>
        /// 给司机捎句话
        /// </summary>
        [Display(Name = "给司机捎句话")]
        public string DriverRemark { get; set; }
        #endregion

        #region 付费方式
        /// <summary>
        /// 付费方式
        /// </summary>
        [Display(Name = "付费方式")]
        [Required(ErrorMessage = "{0} 不能为空")]
        public PayMode PayMode { get; set; }
        #endregion

        #region 发货地信息
        /// <summary>
        /// 出发区县编码
        /// </summary>
        [Display(Name = "出发区县编码")]
        [Required(ErrorMessage = "{0} 不能为空")]
        [RegularExpression(RegexPatterns.NUMBER, ErrorMessage = "{0} 应全部是数字")]
        public string CountyCode { get; set; }
        /// <summary>
        /// 发货地经度
        /// </summary>		
        [Display(Name = "发货地经度")]
        [Required(ErrorMessage = "{0} 不能为空")]
        public double Longitude { get; set; }
        /// <summary>
        /// 发货地纬度
        /// </summary>		
        [Display(Name = "发货地纬度")]
        [Required(ErrorMessage = "{0} 不能为空")]
        public double Latitude { get; set; }
        #endregion

        #region 额外服务
        /// <summary>
        /// 保价服务
        /// </summary>
        [Display(Name = "保价服务")]
        public bool IsInsuredPrice { get; set; }
        /// <summary>
        /// 代收货款服务
        /// </summary>
        [Display(Name = "代收货款服务")]
        public bool IsCod { get; set; }
        /// <summary>
        /// 回单服务
        /// </summary>
        [Display(Name = "回单服务")]
        public bool IsReceipt { get; set; }
        /// <summary>
        /// 有搬运服务（无忧搬家默认开启，便捷搬家、同城只有开启才计算）
        /// </summary>
        [Display(Name = "有搬运服务")]
        public bool HasCarryService { get; set; }
        #endregion

        #region 跟车人
        /// <summary>
        /// 跟车人数
        /// </summary>
        [Display(Name = "跟车人数")]
        public int? WithCarPeopleNumber { get; set; }
        /// <summary>
        /// 跟车人电话
        /// </summary>
        [Display(Name = "跟车人电话")]
        public string WithCarPeoplePhone { get; set; }
        #endregion

        #region 保价服务详细信息
        /// <summary>
        /// 保价配置Id
        /// </summary>
        [Display(Name = "保价配置Id")]
        public int? InsuredConfigId { get; set; }
        /// <summary>
        /// 保价货物价值凭证
        /// </summary>
        [Display(Name = "保价货物价值凭证")]
        public string InsuredPriceCertificates { get; set; }
        /// <summary>
        /// 保价金额(货物保价金额)
        /// </summary>
        [Display(Name = "保价金额(货物保价金额)")]
        public decimal? InsuredPrice { get; set; }
        #endregion

        #region 代收货款详细信息
        /// <summary>
        /// 代收货款总额
        /// </summary>
        [Display(Name = "代收货款总额")]
        public decimal? CodCost { get; set; }
        /// <summary>
        /// 代收货款商品价值凭证
        /// </summary>
        [Display(Name = "代收货款商品价值凭证")]
        public string CodGoodsValueCertificates { get; set; }
        #endregion

        #region 开发票
        /// <summary>
        /// 开发票
        /// </summary>
        [Display(Name = "开发票")]
        public bool IsInvoice { get; set; }
        #endregion

        #region 优惠券信息
        /// <summary>
        /// 优惠券Id
        /// </summary>
        [Display(Name = "优惠券Id")]
        public long? CouponId { get; set; }
        #endregion

        #region 打赏金额
        /// <summary>
        /// 打赏金额
        /// </summary>		
        [Display(Name = "打赏金额")]
        public decimal? GratuityAmount { get; set; }
        #endregion

        /// <summary>
        /// 特殊服务清单
        /// </summary>
        [Display(Name = "特殊服务清单")]
        public List<OrderSpecificServiceRequestDto> SpecificService { get; set; }


    }
}
